package main

import "fmt"

func main() {
	s := make([]int, 5, 10)
	fmt.Printf("%p\n", s)
	//由切片s创建切片s1，两个切片底层共享数组，只不过指向的开始索引不同
	//s1指向数组额开始索引时1，s指向数组的开始索引是0
	//0xc0000ae000
	//0xc0000ae008
	s1 := s[1:]
	fmt.Printf("%p\n", s1)
	fmt.Println("=========")
	s2 := []int{1, 2, 3, 4, 5}
	fmt.Printf("%p\n", s2)
	s3 := []int{6, 7, 8, 9}
	fmt.Printf("%p\n", s3)
	//s3... 解压缩切片操作
	s2 = append(s2, s3...)
	fmt.Printf("%p\n", s2)
	fmt.Println(s2)
}
